package com.hexiang.web;

import com.hexiang.entity.Order;
import com.hexiang.service.OrderServiceImpl;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@Validated
public class OrderController {
    @Resource
    private OrderServiceImpl orderService;

    @GetMapping("/queryOrderByCondition")
    public List<Order> queryOrderByCondition(@RequestParam int userId, @RequestParam String orderIds) {
        return orderService.queryOrderByCondition(userId,orderIds);
    }

    @PostMapping("/saveOrder")
    public String saveOrder(@RequestBody Order order) {
        orderService.saveOrder(order);
        return "ok";
    }
}
